package cn.fourhundredandeighteen.view.Component;

import javax.swing.*;
import java.awt.*;

public class LabelButton extends JLabel {
    public Class content;

    public LabelButton(String text, Class content) {
        this.content = content;
        initComponents(text);
    }

    private void initComponents(String text) {
        this.setText(text);
        this.setPreferredSize(new Dimension(120, 60));
        // 设置背景色和前景色
        this.setOpaque(true);
        this.setBackground(new Color(32, 34, 42));
        this.setForeground(new Color(242, 242, 242));
        // 设置对齐方式为居中对齐
        this.setVerticalAlignment(JLabel.CENTER);
        this.setHorizontalAlignment(JLabel.CENTER);
        // 设置下边框
        this.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(48, 52, 64)));
    }
}
